using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class HR_DeductionsMap : EntityTypeConfiguration<HR_Deductions>
    {
        public HR_DeductionsMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Employee_id)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Date)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Deduction)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Value)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("HR_Deductions");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Employee_id).HasColumnName("Employee_id");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Deduction).HasColumnName("Deduction");
            this.Property(t => t.Value).HasColumnName("Value");
        }
    }
}
